package jannex.sql;

import jannex.JannexException;

public class JxSqlException extends JannexException {

    private final int vendorCode;
    private final String sqlState;

    public JxSqlException(String message, Throwable cause, int vendorCode, String sqlState) {
        super(message, cause);
        this.vendorCode = vendorCode;
        this.sqlState = sqlState;
    }

    public JxSqlException() {
        super();
        this.vendorCode = 0;
        this.sqlState = null;
    }

    public JxSqlException(Throwable cause) {
        super(cause);
        this.vendorCode = 0;
        this.sqlState = null;
    }

    public JxSqlException(String message, Throwable cause) {
        super(message, cause);
        this.vendorCode = 0;
        this.sqlState = null;
    }

    public JxSqlException(String message) {
        super(message);
        this.vendorCode = 0;
        this.sqlState = null;
    }

    public int getVendorCode() {
        return vendorCode;
    }

    public String getSqlState() {
        return sqlState;
    }

    public boolean isTransient() {
        return false;
    }

}
